{layout name="layout/sharewifi" /}
<div class="page-home row-content am-cf">
    <!-- 站点统计 -->
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12 am-margin-bottom">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title">站点统计</div>
                </div>
                <div class="widget-body am-cf">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                        <div class="widget-card card__blue am-cf">
                            <div class="card-header">站点用户</div>
                            <div class="card-body">
                                <div class="card-value">{$count['user']['all']}</div>
                                <div class="card-description">当前用户总数量</div>
                                <span class="card-icon iconfont iconyonghuguanli"></span>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                        <div class="widget-card card__red am-cf">
                            <div class="card-header">加盟商家量</div>
                            <div class="card-body">
                                <div class="card-value">{$count['shop']['all']}</div>
                                <div class="card-description">当前商家总数量</div>
                                <span class="card-icon iconfont icondianpu"></span>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                        <div class="widget-card card__violet am-cf">
                            <div class="card-header">广告曝光</div>
                            <div class="card-body">
                                <div class="card-value">{$count['advert']['all']['show']}</div>
                                <div class="card-description">广告曝光总数量</div>
                                <span class="card-icon iconfont icontongji"></span>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                        <div class="widget-card card__primary am-cf">
                            <div class="card-header">广告点击</div>
                            <div class="card-body">
                                <div class="card-value">{$count['advert']['all']['click']}</div>
                                <div class="card-description">广告点击总数量</div>
                                <span class="card-icon iconfont iconyingxiao"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

	
    <!-- 近七日走势 -->
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12 am-margin-bottom">
            <div class="widget am-cf">
                <div class="widget-head">
                    <div class="widget-title">近七日走势</div>
                </div>
                <div class="widget-body am-cf">
                    <div id="echarts-trade" class="widget-echarts"></div>
                </div>
            </div>
        </div>
    </div>
	<div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="help-block am-text-center">
                <small><?= $web['name']?>&nbsp;&nbsp;版权所有</small>
            </div>
        </div>
    </div>
</div>
<script src="/assets/plugins/echarts/echarts.min.js?v={$version}"></script>
<script src="/assets/plugins/echarts/echarts-walden.js?v={$version}"></script> 
<script type="text/javascript">
    /**
     * 近七日交易走势
     */
    var dom = document.getElementById('echarts-trade');
    echarts.init(dom, 'walden').setOption({
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['新入用户', '新入商家', '广告曝光', '广告点击']
        },
        toolbox: {
            show: true,
            showTitle: false,
            feature: {
                mark: {show: true},
                magicType: {show: true, type: ['line', 'bar']}
            }
        },
        calculable: true,
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ["<?= date("Y-m-d")?>","<?= date("Y-m-d",strtotime("-1 day"))?>","<?= date("Y-m-d",strtotime("-2 day"))?>","<?= date("Y-m-d",strtotime("-3 day"))?>","<?= date("Y-m-d",strtotime("-4 day"))?>","<?= date("Y-m-d",strtotime("-5 day"))?>","<?= date("Y-m-d",strtotime("-6 day"))?>"]        
		},
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name: '新入用户',
                type: 'line',
                data: [<?= $count['user']['today'] ?>,<?= $count['user']['today2'] ?>,<?= $count['user']['today3'] ?>,<?= $count['user']['today4'] ?>,<?= $count['user']['today5'] ?>,<?= $count['user']['today6'] ?>,<?= $count['user']['today7'] ?>]
			},
            {
                name: '新入商家',
                type: 'line',
                data: [<?= $count['shop']['today'] ?>,<?= $count['shop']['today2'] ?>,<?= $count['shop']['today3'] ?>,<?= $count['shop']['today4'] ?>,<?= $count['shop']['today5'] ?>,<?= $count['shop']['today6'] ?>,<?= $count['shop']['today7'] ?>]
            },
            {
                name: '广告曝光',
                type: 'line',
                data: [<?= $count['advert']['today']['show'] ?>,<?= $count['advert']['today2']['show'] ?>,<?= $count['advert']['today3']['show'] ?>,<?= $count['advert']['today4']['show'] ?>,<?= $count['advert']['today5']['show'] ?>,<?= $count['advert']['today6']['show'] ?>,<?= $count['advert']['today7']['show'] ?>]
			},
            {
                name: '广告点击',
                type: 'line',
                data: [<?= $count['advert']['today']['click'] ?>,<?= $count['advert']['today2']['click'] ?>,<?= $count['advert']['today3']['click'] ?>,<?= $count['advert']['today4']['click'] ?>,<?= $count['advert']['today5']['click'] ?>,<?= $count['advert']['today6']['click'] ?>,<?= $count['advert']['today7']['click'] ?>]
			}
        ]
    }, true);
</script>